﻿class Tooltip1 {
	
	private var theTip:MovieClip;
	private var tFormat:TextFormat;
	private var text_length:Number=95;	
	var rect_color:Number=0xECF8FF;
	var word_color:Number=0x000000;
	public function showTip(my_text:String,rect_width:Number):Void 
	{
		this.theTip = _root.createEmptyMovieClip("tooltip", 23);		
	
		this.theTip.createEmptyMovieClip("rect", 22);		
		this.theTip.rect.beginFill(this.rect_color);
		this.theTip.rect.lineStyle(1, this.word_color, rect_width);
		this.theTip.rect.moveTo(0, 0);
		this.theTip.rect.lineTo(rect_width, 0);
		this.theTip.rect.lineTo(rect_width, 20);
		this.theTip.rect.lineTo(20, 20);
		this.theTip.rect.lineTo(10, 30);
		this.theTip.rect.lineTo(10, 20);
		this.theTip.rect.lineTo(0, 20);
		this.theTip.rect.lineTo(0, 0);
		this.theTip.rect.endFill();
		this.theTip.rect._visible = true;
		
		this.theTip.createTextField("theText",24,3,1,120,20);
		this.theTip.theText.selectable = false;
		this.tFormat = new TextFormat();
		this.tFormat.font = "Arial";
		this.tFormat.size = 11;
		this.tFormat.align = "left";
		this.theTip.theText.setNewTextFormat(this.tFormat);		
		
		this.theTip.theText.text = my_text;
		this.theTip._x = _root._xmouse ;
		this.theTip._y = _root._ymouse - 35;
		this.theTip._visible = true;
		
		this.theTip.onMouseMove = function() {
			this._x = _root._xmouse ;
			this._y = _root._ymouse-35;
			updateAfterEvent();
		}
		
	}
	
	public function removeTip():Void {
		this.theTip.unloadMovieNum(21);
		this.theTip.unloadMovieNum(22);
		this.theTip.unloadMovieNum(23);				
		this.theTip.unloadMovieNum(24);		
		this.theTip._visible = false;
		delete this.theTip.onEnterFrame;
		
	}

}
